package brad.zimmerman.dungeon.game;

import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.Window;

public class ActivitySplashScreenReturn extends Activity{
	
	
		   @Override
		   public void onCreate(Bundle savedInstanceState){
		      super.onCreate(savedInstanceState);
		      requestWindowFeature(Window.FEATURE_NO_TITLE);
		      // set the content view for your splash screen you defined in an xml file
		      setContentView(R.layout.loadingscreen);
		      //System.out.println("SplashScreenReturn");
		      // perform other stuff you need to do

		      // execute your xml news feed loader
		      new AsyncReturnGameData().execute();

		   }

		   private class AsyncReturnGameData extends AsyncTask<Void, Void, Void>{
		      @Override
		      protected void onPreExecute(){
		            // show your progress dialog

		      }

		      @Override
		      protected Void doInBackground(Void... voids){
				return null;
		            // load your xml feed asynchronously
		      }

		      @Override
		      protected void onPostExecute(Void params){
		            // dismiss your dialog
		            // launch your News activity
		  			// TODO Add extras or a data URI to this intent as appropriate.
		    	  	Intent intent = new Intent(ActivitySplashScreenReturn.this, ActivityDungeons.class);
		    	  	intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT );
		        	//results.printInfo();
		   		 	//b.putSerializable("bundleobj", results);
		   		 	//resultIntent.putExtras(b);
		        	// TODO Add extras or a data URI to this intent as appropriate.
		    	  	startActivity(intent);
		    	  	//This activity will hang so that the loading screen can be viewed until the results are posted
		        	finish();
		      }

		   }
}

